import flRequest from '../../index'

import {
  IDoctorInfo,
  ISetAppointment,
  IGetAppointment,
  IAppointmentCheck,
  ISetTab,
  CNInquiry,
  WSInquiry,
  ISetInfo,
  IPrescripition
} from './type'
import { IDataType } from '../../type'
enum DoctorApi {
  DoctorInfo = 'Doctor_Index.DoctorInfo', //获取医生信息
  DoctorSetAppointment = 'Doctor_Doctor.SetAppointment', //设置预约时间
  DoctorIncome = 'Doctor_Doctor.DoctorIncome', //医生收入统计
  GetAppointment = 'Doctor_Doctor.GetAppointment', // 获取设置预约时间
  GetAppointmentUserList = 'Doctor_Doctor.GetAppointmentUserList', // 获取用户预约列表
  AppointmentCheck = 'Doctor_Doctor.AppointmentCheck', //审核预约
  CommentList = 'Doctor_Doctor.CommentList',
  DoctorDoctorSetTab = 'Doctor.DoctorSetTab', // 设置标签
  ConsultCnMedicine = 'Consult.CnMedicine', //获取中药列表
  ConsultWestMedicine = 'Consult.WestMedicine', // 获取西药
  ConsultSaveInquiry = 'Consult.SaveInquiry', //西药提交问诊
  ConsultCNSaveInquiry = 'Consult.CNSaveInquiry', //中药提交问诊
  PraiseList = 'Doctor_Doctor.PraiseList', //获取点赞列表
  ArticleCollectList = 'Doctor_Doctor.ArticleCollectList', //收藏列表
  SetInfo = 'Doctor_Index.SetInfo', //医生/管理师更新信息
  PrescriptionList = 'Doctor_Doctor.PrescriptionList' // 处方列表
}
export function DoctorInfo() {
  return flRequest.get<IDataType<IDoctorInfo>>({
    url: DoctorApi.DoctorInfo,
    showLoading: false
  })
}
export function DoctorIncome() {
  return flRequest.post<IDataType>({
    url: DoctorApi.DoctorIncome,
    showLoading: false
  })
}

export function DoctorSetAppointment(params: ISetAppointment) {
  return flRequest.post<IDataType>({
    url: DoctorApi.DoctorSetAppointment,
    data: params,
    showLoading: false
  })
}

export function GetAppointment() {
  return flRequest.post<IDataType>({
    url: DoctorApi.GetAppointment,
    showLoading: false
  })
}

export function GetAppointmentUserList(postdata: IGetAppointment) {
  return flRequest.post<IDataType>({
    url: DoctorApi.GetAppointmentUserList,
    data: postdata
  })
}

export function AppointmentCheck(postData: IAppointmentCheck) {
  return flRequest.post<IDataType>({
    url: DoctorApi.AppointmentCheck,
    data: postData
  })
}
export function CommentList(postData: IGetAppointment) {
  return flRequest.post<IDataType>({
    url: DoctorApi.CommentList,
    data: postData
  })
}
export function DoctorDoctorSetTab(postData: ISetTab) {
  return flRequest.post<IDataType>({
    url: DoctorApi.DoctorDoctorSetTab,
    data: postData
  })
}
export function ConsultCnMedicine() {
  return flRequest.post<IDataType>({
    url: DoctorApi.ConsultCnMedicine
  })
}
export function ConsultWestMedicine() {
  return flRequest.post<IDataType>({
    url: DoctorApi.ConsultWestMedicine
  })
}
export function ConsultCNSaveInquiry(data: CNInquiry) {
  return flRequest.post<IDataType>({
    url: DoctorApi.ConsultCNSaveInquiry,
    data
  })
}
export function ConsultSaveInquiry(data: WSInquiry) {
  return flRequest.post<IDataType>({
    url: DoctorApi.ConsultSaveInquiry,
    data
  })
}
export function PraiseList(postData: IGetAppointment) {
  return flRequest.post<IDataType>({
    url: DoctorApi.PraiseList,
    data: postData
  })
}

export function ArticleCollectList(postData: IGetAppointment) {
  return flRequest.post<IDataType>({
    url: DoctorApi.ArticleCollectList,
    data: postData
  })
}

export function SetInfo(postData: ISetInfo) {
  return flRequest.post<IDataType>({
    url: DoctorApi.SetInfo,
    data: postData
  })
}

export function PrescriptionList(postData: IPrescripition) {
  return flRequest.post<IDataType>({
    url: DoctorApi.PrescriptionList,
    data: postData
  })
}
